<?php
    require ('./Utils.php');

    $post = getJsonParamter();

    $pet_id = $post['pet_id'];
    $username = $post['username'];
    $content = $post['content'];
    $date =  date("Y-m-d H:i:s");

    $sql = "INSERT INTO board(user_id, pet_id, content, date) VALUES(?, ?, ?, ?)";

    $conn = getConnection();
    $result = execute($conn, $sql, $username, $pet_id, $content, $date);

    if($result) getJson(200, '发送成功', null);

    else getJson(500, '发送失败', null);
?>